<div class="panel panel-default panel-intro">
    {:build_heading()}
    <div class="panel-body">
        <form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
            {:token()}
            
            <div class="alert alert-warning-light">
                1. 订阅号提供了每天一条的群发权限。<br/>
                2. 服务号提供每月（自然月）4条的群发权限。
            </div>
            <div class="form-group">
                <label for="c-title" class="control-label col-xs-12 col-sm-2">{:__('分组群发')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <select name="row[group]" class="form-control" disabled="">
                        <option value="">全部用户</option>
                        <?php if(is_array($groups)):?>
                        <?php foreach($groups as $group):?>
                        <option value="{$group['group_id']}" <?php if($group['group_id'] == $row['group']){echo "selected";}?> >{$group['name']}</option>
                        <?php endforeach;?>
                        <?php endif;?>
                    </select>
                </div>
                <div style="clear: both;"></div>
            </div>
            <div class="form-group" style="margin-bottom: 15px;">
                <label for="c-keyword" class="control-label col-xs-12 col-sm-2">{:__('发送内容')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <p style="padding-top:7px;">
                        <input type="radio" disabled="" name="row[type]" value="text" <?php if($row['type'] == 'text'){echo "checked='checked'";}?> > 文字　
                        <input type="radio" disabled="" name="row[type]" value="image" <?php if($row['type'] == 'image'){echo "checked='checked'";}?> > 图片　
                        <input type="radio" disabled="" name="row[type]" value="mpnews" <?php if($row['type'] == 'mpnews'){echo "checked='checked'";}?> data-href="{:url('material/item')}"> 图文
                    </p>
                    <!--文字内容-->
                    <div class="_content content-text" style="display:  {$t['text']}">
                        <textarea  disabled="" id="c-content" class="form-control simple-editor" name="row[content]">{:isset($row['content']) ? $row['content'] : ''}</textarea>
                    </div>
                    <!--图片内容-->
                    <div class="_content content-image" style="display:  {$t['image']}">
                        <div class="input-group">
                            <input id="c-image" disabled="" class="form-control" size="35" name="row[image]" type="text" value="{:isset($row['image']) ? $row['image'] : ''}">
                            <input type="hidden" id="_media_id" name="row[media_id]" value="{:isset($row['media_id']) ? $row['media_id'] : ''}" >
                            <div class="input-group-addon no-border no-padding">
                                <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/jpeg,image/png,image/jpg,image/bmp" data-url="{:url('ajax/wxupload')}" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                                <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                            </div>
                            <span class="msg-box n-right"></span>
                        </div>
                        <ul class="row list-inline faupload-preview" id="p-image"></ul>
                    </div>
                    <!--图文内容-->
                    <div class="_content content-material content-mpnews " style="display:  {$t['mpnews']}">
                        <?php if(isset($material) && !empty($material)):?>
                            <div class="material-items">
                                <div class="material-body" style="border:1px solid #ccc;">
                                    <input type="hidden" name="row[material_id]" value="{$material['id']}">
                                    <div class="material_item item-1 active" data-aid="0" id="appmsg-item-0">
                                        <div class="appmsg_thumb _thumb" style="background-image:url('{$material['thumb']|default='/assets/img/circle.png'}');"></div>
                                        <div class="appmsg_text _title">{$material['title']|default='我是标题...'}</div>
                                    </div>
                                    <?php if($material['items']):?>
                                    
                                    <?php foreach($material['items'] as $k=>$item):?>
                                        <div class="material_item item-last" id="appmsg-item-{$k+1}" data-aid="{$k+1}">
                                            <div class="item-last-body">
                                                <div class="appmsg-title">
                                                    <strong class="_title">{$item['title']}</strong>
                                                </div>
                                                <div class="appmsg_thumb">
                                                    <img class="_thumb" src="{$item['thumb']}">
                                                </div>
                                            </div>
                                            
                                        </div>
                                    <?php endforeach;?>
                                    <?php endif;?>
                                </div>
                            </div> 
                            <?php endif;?>
                    </div>
                </div>
                <div style="clear: both;"></div>
            </div>
            <div class="form-group layer-footer">
            <!-- <div class="col-xs-12 col-sm-8 text-right">
                <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
                <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
            </div> -->
        </div>
        </form>
    </div>
</div>
